<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>使用CSS实现两边细中间粗的渐变直线</title>
  <style>
    body {
      color: #fff;
      background: #1b6d85;
    }

    .line {
      width: 500px;
      height: 2px;
      background: linear-gradient(243deg, rgba(255, 255, 255, 0) 0%, #00ffcd 50%, rgba(255, 255, 255, 0) 100%);
    }

    .line1 {
      width: 1px;
      height: 400px;
      margin: 0 50px;
      background: linear-gradient(244deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 0) 100%);
    }

    .line2 {
      width: 80px;
      height: 1px;
      background: linear-gradient(244deg, rgba(0, 255, 255, 1) 50%, rgba(255, 255, 255, 0) 100%);
    }

    .line3 {
      width: 80px;
      height: 1px;
      background: linear-gradient(244deg, rgba(255, 255, 255, 0) 0%, rgba(0, 255, 255, 1) 50%);
    }

    .blue-gray-line {
      width: 300px;
      height: 23px;
      border-right: 150px solid rgba(216, 216, 216, 1);
      background: rgb(50, 223, 220);
    }
  </style>
</head>

<body>
  <h2>（1）中间粗两边细的渐变直线</h2>
  <div class="line"></div>
  <div class="line1"></div>
  <h2>（2）左边细右边粗的渐变直线</h2>
  <div class="line2"></div>
  <h2>（3）右边细左边粗的渐变直线</h2>
  <div class="line3"></div>
  <h2>（4）一线两色</h2>
  <div class="blue-gray-line"></div>
</body>

</html>